﻿using 订单处理系统.Entity;
using 订单处理系统.Model;

namespace 订单处理系统.Repository
{
    public class ProductRepository
    {
        private OrderDbContext OrderDbContext;

        public ProductRepository(OrderDbContext orderDbContext)
        {
            OrderDbContext = orderDbContext;
        }

        public async Task Add(Product product)
        {
            OrderDbContext.Add(product);
            await OrderDbContext.SaveChangesAsync();
            return;
        }

        public async Task update(Product product)
        {
            OrderDbContext.Update(product);
            await OrderDbContext.SaveChangesAsync();
            return;
        }
    }
}